<?php


namespace App\Models;


use Askedio\SoftCascade\Traits\SoftCascadeTrait;
use Illuminate\Database\Eloquent\SoftDeletes;

class WarehouseAreaModel extends BaseModel
{
    use SoftDeletes;
    use SoftCascadeTrait;

    protected $softCascade = ['WarehouseShelf'];
    protected $primaryKey = 'warehouse_area_id';
    protected $table = 'warehouse_area';

    public function Warehouse()
    {
        return $this->belongsTo(WarehouseModel::class, 'warehouse_id', 'warehouse_id');
    }

    public function WarehouseShelf()
    {
        return $this->hasMany(WarehouseShelfModel::class, 'warehouse_area_id', 'warehouse_area_id');
    }
}
